package com.rightsidetech.system.dtos.request;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * sys_battery_check
 * @author 
 */
@Data
public class BatteryCheckHandleReq implements Serializable {

    @ApiModelProperty("id")
    @NotNull(message = "id不能为空")
    private Long id;

    @ApiModelProperty("质保期 1换新 2换专 3换维")
    @NotNull(message = "质保期参数不能为空")
    @Range(min = 1,max = 3,message = "质保期参数错误")
    private Byte warranty;

    @ApiModelProperty("检测结果 1电池正常 2可以更换")
    @NotNull(message = "检测结果参数不能为空")
    @Range(min = 1,max = 2,message = "检测结果参数错误")
    private Byte checkResult;

    @ApiModelProperty("放电时长")
    @NotNull(message = "放电时长不能为空")
    private Long dischargeTime;

    @ApiModelProperty(value = "检测时间 yyyy-MM-dd")
    @Pattern(regexp = "^$|^(19|20)\\d{2}\\-[01]\\d\\-[0123]\\d$", message = "日期格式不正确，如yyyy-MM-dd")
    @NotEmpty(message = "检测时间不能为空")
    private String checkTime;

    @ApiModelProperty("报告文件")
    @Pattern(regexp = "^$|^http://.*|https://.*",message = "报告文件参数格式错误")
    private String reportPicture;

    @ApiModelProperty(hidden = true)
    private Long agentId;

    @ApiModelProperty(value = "处理人", hidden = true)
    private String handleName;
}
